# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=fcgi
_pkgname=fcgi2
pkgver=2.4.2
pkgrel=4
pkgdesc="FAST CGI(fcgi) is a language independent, high performant extension to CGI"
url="https://github.com/FastCGI-Archives/fcgi2"
arch="all"
license="OML"
options="!check" # no test suite
makedepends="libtool autoconf automake"
subpackages="$pkgname-dev $pkgname++:xx"
source="$_pkgname-$pkgver.tar.gz::https://github.com/FastCGI-Archives/fcgi2/archive/$pkgver.tar.gz"

builddir="$srcdir/$_pkgname-$pkgver"

build() {
	export LIBS="-lm"
	./autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-shared
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

xx() {
	pkgdesc="FCGI c++ library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*++* "$subpkgdir"/usr/lib/
}

sha512sums="03aca9899eacfd54c878b30691cc4f8db957a065b46426d764003fd057cbf24b4e12ddd26c9b980d5d8965ca40831e415d330e9830529c0d4153400b5c2c8c02  fcgi2-2.4.2.tar.gz"
